import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const count = ref(0)
  const doubleCount = computed(() => count.value * 2)
  const musicIsPlay=ref(false)
  const data=undefined;
  function increment() {
    count.value++
  }

  function suspend(){
    console.log('音乐暂停')
    musicIsPlay.value=false
  }
  function play(){
    console.log('音乐播放')
    musicIsPlay.value=true
  }
  return { count, doubleCount, increment,musicIsPlay ,suspend,play,data}
})
